package cn.edu.jju.psytest.model.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;

@Entity
@Table(name = "tb_quiz_records")
public class QuizRecord {

	private int quizRecordId;
	private String studentId;
	private int quizId;
	private String answers;
	private Date createdDate;

	/**
	 * Getters And Setters
	 */
	
	@Id
	@GeneratedValue
	@Type(type = "int")
	@Column(name = "quiz_record_id")
	public int getQuizRecordId() {
		return quizRecordId;
	}

	public void setQuizRecordId(int quizRecordId) {
		this.quizRecordId = quizRecordId;
	}
	
	@Type(type = "string")
	@Column(length = 20)
		public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}
	
	@Type(type = "int")
	@Column(name = "quiz_id")
	public int getQuizId() {
		return quizId;
	}

	public void setQuizId(int quizId) {
		this.quizId = quizId;
	}
	
	@Type(type = "string")
	@Column(length = 300)
	public String getAnswers() {
		return answers;
	}

	public void setAnswers(String answers) {
		this.answers = answers;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "created_date")
	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
}
